﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GetNewItem : MonoBehaviour
{
    public Item[] item;
    public MainItem mainItem;

    public static GetNewItem _instance;
    private void Awake()
    {
        _instance = this;
    }
    public void GetNew(int ye)
    {
        Item newItem = new Item
        {
            id = mainItem.itemList.Count,
            itemCategory = item[ye].itemCategory,
            selled = false,
            itemName = item[ye].itemName,
            itemImage = item[ye].itemImage,
            itemGrade = 0,
            attribute = new float[] { VariableDocument.GetInstance.all_equip_attribute[ye,0], VariableDocument.GetInstance.all_equip_attribute[ye, 1], VariableDocument.GetInstance.all_equip_attribute[ye, 2], VariableDocument.GetInstance.all_equip_attribute[ye, 3], VariableDocument.GetInstance.all_equip_attribute[ye, 4] }
        };
        mainItem.itemList.Add(newItem);
        //mainItem.CreateExampleAsset(mainItem.itemList.Count, newItem);
    }
}
